home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Skunkware 98
/
Skunkware 98.iso
/
src
/
mail
/
pine3.96.tar.gz
/
pine3.96.tar
/
pine3.96
/
imap
/
non-ANSI
/
unansi
Wrap
Text File
|
1990-03-27
|
728b
|
40 lines
#!/bin/sh
#
# convert ansi-C to old-vanilla-C if it conforms to coding conventions:
# all function definitions and declaractions must be of the form
# stuff (...);
# or stuff (...)
#
# another quickie by:
# Corey Satten, corey@cac.washington.edu, 12/8/89
TMP=/tmp/unansi$$
trap "rm -f $TMP; exit 0" 0 1 2 13 15
for f in $*; do
sed '
/^#/b
: joinl
/ $/s/ *$//;
/ $/s/ *$//;
/^\([^ ()][^()]*\)(.*,$/ {
N
s/\n/ /
b joinl
}
/^\([^ ()][^()]*\)(.*);$/s//\1 ();/
/^\([^ ()][^()]*\)([ ]*)$/b
/^\([^ ()][^()]*\)(.*)$/ {
h
: loop
s/\([(,]\)[^,)][^,)]*[ *]\([a-zA-Z_][a-zA-Z_]*\)[][ ]*\([,)]\)/\1\2\3/g
t loop
p
g
s/^.*(\(.*\))$/ \1;/
s/,/;\
\ /g
}
' $f > $TMP && mv $TMP $f
done